<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'teamForm.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <div>
    <form id="mainform" action="/basketballManage/team/${action}" method="post">
        <table class="formTable">
            <tr style="line-height:80px">
                <td></td>
            </tr>
            <tr>
                <td>队名：</td>
                <td>
                    <input type="hidden" name="id" value="${team.id}"/>
                    <input name="teamName" type="text" value="${team.teamName}" class="easyui-validatebox"
                           required="required"/>
                </td>
            </tr>
            <tr>
                <td>描述：</td>
                <td><textarea rows="2" cols="41" name="description"
                              style="font-size: 12px;font-family: '微软雅黑'">${team.description}</textarea></td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">
    $(function () {
        $('#mainform').form({
            onSubmit: function () {
                var isValid = $(this).form('validate');
                return isValid;	// 返回false终止表单提交
            },
            success: function (data) {
                alert(data);
                if (data) {
                    $('#dg').datagrid('reload');
                    d.panel('close');
                } else {
                    console.log('插入失败，重复');
                    d.panel('close');
                }
            }
        });
    });
</script>
  </body>
</html>
